#ifndef REACHSHAREDMEMORYRECV_H
#define REACHSHAREDMEMORYRECV_H

#include <QThread>
#include <QMutex>
#include <QFile>
#include <QString>
#include <QWaitCondition>
#include <QSharedMemory>

#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef Q_OS_LINUX
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/shm.h>
#include <sys/prctl.h>
#endif

#include "ReachRecvType.h"

class ReachSharedMemoryRecv : public QThread
{
    Q_OBJECT

public:
    ReachSharedMemoryRecv(QObject *parent = 0);
    ~ReachSharedMemoryRecv();

    void run() override;

    void startSharedMemoryRecv(void *funCB);
    void quitSharedMemoryRecv();

Q_SIGNALS:
    void newDataComming(unsigned char *buf, int iLen, void *pvideoInfo);

private:
    bool  m_bQuit;
    void *m_pVideoCallBack;
};

#endif // REACHSHAREDMEMORYRECV_H
